import * as api from '@/api/file'
const file = {
	state: {
		doname: ''
	},
	mutations: {
		SET_DONAME: (state, doname) => {
			state.doname = doname
		}
	},
	actions: {
		GetDoname({ commit, state }) {
			return new Promise((resolve, reject) => {
				api.doname().then(res => {
					const data = res.data
					commit('SET_DONAME', `http://${data}`)
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		}
	}
}
export default file